#ifndef WINDOW_H
#define WINDOW_H

#include <QDialog>
#include <QSystemTrayIcon>
#include <QMenu>
#include <QPalette>
#include <QColor>
#include <QToolTip>
#include <QString>
#include <phonon>
#include "alarm.h"
#include "audio.h" 
#include "url.h" 
#include "utils.h" 
#include <iostream>
#include <QKeyEvent>

class Window : public QDialog
{  
  Q_OBJECT     
  public:
  	Window(); 
  	//static bool changed;	  	
  protected:
  	void timerEvent(QTimerEvent *e);  	
  	void keyPressEvent(QKeyEvent *event);
  private slots:
	void setAlarm();
	void setAudio();
	void playAudio();
	void stopAudio();
	void setUrl();	
	void openUrl();	
	void _about();	
	
  private:
  	QAction *aboutAction;
	QAction *quitAction;
	QAction *setalarm;
	QAction *setaudio;
	QAction *playaudio;
	QAction *stopaudio;
	QAction *seturl;
	QAction *openurl;
	QAction *aboutQtAction;
	QSystemTrayIcon *trayIcon;
	QMenu *trayIconMenu;
	QUrl * url;
	QProcess *playFile;	
	void createActions();
	void createTrayIcon();	
	void startAlarm();	
	void init();		
  	void updateTrayIcon();  
  	int getRepeat();
  	int timer;
  	int repeat; 
  	QString alarmTime;	
  	QString alarmDate;	 	
  	QString alarmDay;
  	Phonon::MediaObject *music;
  	Phonon::State state;  
	QString path;
	QString imgfile;
	Url urlWindow;
	Audio audioWindow;
	Alarm alarmWindow;
}; 

#endif 
